<!--
 * @Author: your name
 * @Date: 2021-09-09 16:06:10
 * @LastEditTime: 2021-09-14 18:03:24
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \hello-uni\pages\index\components\Jianbao.vue
-->
<template>
	<view class="jianbao">
		<!-- 简报看板 -->
		<Title :title="title" :text="text"/>	
		<!-- 客户数据 -->
		<card :cards="cards"/>
		<!-- 查看详情 -->
		<Detail :url="url"/>
		
	</view>
</template>

<script>
	import Title from './common/Title.vue';
	import Card from './common/Card.vue';
	import Detail from './common/Detail.vue';
	import { ref , reactive } from "vue";
	import  request from '@/service/request1.js'
	// import { defineAsyncComponent } from 'vue';
	// const Title = defineAsyncComponent(() => import('./common/Title.vue'));
	
	export default {
		components: {
			Title,Card,Detail
		},

		mounted() {
		},
		setup(props){
			const title = ref("加载中...")
			const text = ref("(权限内/2021年9月)")
			const cards = reactive([])
			console.log(props)
			const url = ref('/components/components/jianbaokanban')
			

			request('/api/workbench/deskmode?modetype=jianbao',{
				dateRang: ["2021-09-01", "2021-09-30"],
				selectType: ""
			 	},'POST').then(res=>{
					console.log(res)
					title.value = res.data.result.title  // 标题赋值
					const cardsdata = res.data.result.data // 卡片数据
					 cardsdata.forEach(e => {  //  卡片数据赋值
					    cards.push(e);
					  });
				})
			return{
				title,
				text,
				cards,
				url
				
			}
		}
		}
</script>

<style scoped lang="scss">

	
	
	
</style>
